package com.netty.demo.integration;

import com.alibaba.fastjson.JSONObject;
import com.fengzai.demo.dto.AnimalDto;
import com.fengzai.demo.facade.MessageFacade;
import com.fengzai.netty.rpc.annotation.RpcService;
import org.springframework.web.multipart.MultipartFile;

/**
 * @PACKAGE_NAME: com.fengzai.demo.integration
 * @author: rhf
 * @ProjectName: netty
 * @DATE: 2021/11/4
 **/
@RpcService
public class MessageFacadeImpl implements MessageFacade {
    @Override
    public void sayMsg1() {
        System.out.println("进入sayMsg1");
    }

    @Override
    public void sayMsg2(String x) {
        System.out.println("进入sayMsg2， 参数:" + x);

    }

    @Override
    public String sayMsg3() {
        System.out.println("进入sayMsg3");
        return "sayMsg3";
    }

    @Override
    public String sayMsg4(String x) {
        System.out.println("进入sayMsg4， 参数:" + x);
        return "sayMsg4";
    }

    @Override
    public String transferFile(MultipartFile multipartFile) {
        System.out.println("进入transferFile， 参数:文件");
        return "transferFile";
    }

    @Override
    public String serial(AnimalDto animalDto) {
        System.out.println("进入serial， 参数:"+ JSONObject.toJSONString(animalDto));
        return "animalDto";
    }

    @Override
    public String intType(int i) {
        System.out.println("进入serial， 参数:"+ i);
        return "intType";
    }
}
